define(function(require, exports, module) {

	var common = require('common');

	var init = function() {
		$("#btnOfficeList, #btnReturn").click(function() {
			common.ajaxLoadPage($(this).attr("href"));
			return false;
		});
		$("#btnSave").click(function() {
			if ($("#officeInfoForm").validate().form()) {
				$("#officeInfoForm").submit();
			}
		});

		var rules = {
                officeName : {
                    required : true
                },
                officeId : {
                    required : true
                },
                address : {
                    required : true
                },
                post : {
                    required : true
                },
                master : {
                    required : true
                },
                email : {
                    required : true
                }
            };
		common.handleSubmit($("#officeInfoForm"), rules);

        /* 控件初始化 */
        $("select").select2();
	}

	return {
		init : init
	}
});